<?php
class BookListWidget extends Widget{
	public function render($data){
			foreach ($data['group'] as $k=>$v){
				$map['fid']     = $k;
				$map['type']    = array('IN',array('group_forum','group_file','group_blog','group_wiki','group_reply')); 
				$list = x('Feed')->get($map,'',false,1,true);
				if(!empty($list['data'])) $data['list'][$k] =$list['data'];
			}
		$content = $this->renderFile(dirname(__FILE__)."/BookList.html",$data);
		return $content;		
    } 

	function getGroupName($gid){
		$list = M('group_x')->where('$gid='.$gid)->find();
		$name = $list['name'];
		return $name;
	}
}
?>